package com.roden.ice.server;



import Ice.Communicator;
import Ice.Current;
import Ice.Logger;
import Ice.ObjectAdapter;
import IceBox.Service;
import com.roden.slice._HelloWorldDisp;

public class HelloWordldI extends _HelloWorldDisp implements Service {
	 /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Logger log;
	 private ObjectAdapter _adapter;
	@Override
	public String sayHello(String s, Current __current) {
		
		System.out.println("client message:"+s);
		return "Hello World:"+s;
	}
	  @Override
	    public void start(String name, Communicator communicator, String[] args) {
	        this.log = communicator.getLogger().cloneWithPrefix(name);
	        _adapter = communicator.createObjectAdapter(name);
	        Ice.Object object = this;
	        _adapter.add(object, communicator.stringToIdentity(name));
	        _adapter.activate();
	        log.trace("control", " started ");
	    }

	    @Override
	    public void stop() {
	        log.trace("control", " stoped ");
	        _adapter.destroy();

	    }
}
